<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\DB;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        error_reporting(0);
        
        # DB::listen(function ($query) {
        #    echo $query->sql;
        #    // $query->bindings
        #    // $query->time
        #});
        Validator::extend('money', function ($attribute, $value, $parameters, $validator) {
            return preg_match('#^[0-9]{1}\d*(.\d{1,2})?$#', $value);
        });
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
